Re: [Interest] BUG? QTimer in QThread

2014-05-14 Thread Sensei
On 5/13/14, 2:16pm, Mandeep Sandhu wrote: > On Tue, May 13, 2014 at 5:33 PM, Filip Piechocki wrote: >> I would like to mention, that in the first email the thread is never started >> and without starting the thread I would not expect much to happen in this >> thread :) > > I was about to say the s

Re: [Interest] BUG? QTimer in QThread

2014-05-13 Thread Sensei
On 13/05/14 13:48, Mandeep Sandhu wrote: > Without seeing the full code I can't comment on what the problem might be. > > However I quickly wrote a small test app which essentially does > whatever you've mentioned. It works fine on my Ubuntu setup with both > Qt5 (5.2.0) and Qt4 (4.8.6). > > Have a

Re: [Interest] BUG? QTimer in QThread

2014-05-13 Thread Sensei
On 13/05/14 13:34, André Somers wrote: > I think the root of your problem may be that you are starting your timer > from the constructor of myClass, and then move the instance of myClass > to a thread. What happens if you do something like this? > > Q_SLOT myClass::start() > { >inThread_ =

[Interest] BUG? QTimer in QThread

2014-05-13 Thread Sensei
Dear all, I am reporting this weird behavior because I believe it could be a potential bug: my code is too simple to have an unexpected behavior. Anyway *BEWARE*: I might be making a huge mistake in my code that I don't see! Please forgive me if I am wrong! :) So, here I go. I have a class t

[Interest] QTableWidget fading cell

2014-05-12 Thread Sensei
Dear all, I am trying to make my QTableWidget look good, although I have no real skills with that respect :) Anyway, here's what I'd like to do: the rightmost cell in the widget should have its text fade to transparent. Right now I'm using in each cell a QLabel (I need few strokes of HTML), b

Re: [Interest] Thread guarantee on slots+timers

2014-04-15 Thread Sensei
On 14/04/14 13:04, André Somers wrote: > No, then you misunderstood the above. If you use an auto connection (the > default) or a queued connection to hook up your GUI thread to the slot, > you have fulfilled the criteria for the slot to be only triggered from > within the same thread, and thus str

Re: [Interest] Thread guarantee on slots+timers

2014-04-14 Thread Sensei
On 4/11/14, 10:26am, André Somers wrote: > Not quite, and it is not such a simple question at all. It depends on > which thread actually triggers the slot, and how. If you were to trigger > the slot, either by a direct method call or using a direct connection, > from two different threads, there ar

[Interest] Thread guarantee on slots+timers

2014-04-11 Thread Sensei
Dear all, quite a simple question here. I have an object living in a QThread, and this object has a timer executing a public slot every X seconds. If by chance I force calling the slot and meanwhile the timer emits a timeout() (or the other way round FWIW), am I guaranteed that the slot execut

[Interest] Deploying on Mac permissions and automation

2014-04-07 Thread Sensei
: sensei:Debug% macdeployqt MyApp.app ERROR: "error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: file: /Users/sensei/Documents/Projects/MyApp/MyApp/DerivedData/MyApp/Build/Products/Debug/MyApp.app/Contents/Frameworks/QtCore.framework/Versi

Re: [Interest] QMessageBox default sizes

2014-04-07 Thread Sensei
On 4/2/14, 2:32pm, Sensei wrote: > However, I can't set minimum sizes of the dialog with the following: > > box_->layout()->setSizeConstraint(QLayout::SetMinimumSize); > box_->setMinimumSize(400, 150); > > Could this be a problem in setting constraints b

Re: [Interest] QMessageBox default sizes

2014-04-02 Thread Sensei
On 4/2/14, 12:43pm, Rutledge Shawn wrote: > This is a minimalist dialog which doesn't take up any more space than > necessary, so the default size will depend on what is being > displayed, and is determined by the layout (see e.g. > QMessageBoxPrivate::layoutMinimumWidth()). After you show the dia

[Interest] QMessageBox default sizes

2014-04-02 Thread Sensei
Dear all, How can I reproduce the aesthetics of a QMessageBox::warning and similar static functions? I am trying to make a platform-specific dialog box that handles informativeText (yes, just that! at least for now). However, I don't know how to retrieve the default sizes, and printing them i

Re: [Interest] Changing permissions in a dir

2014-04-02 Thread Sensei
On 3/31/14, 2:28pm, Bob Hood wrote: >> Second: can I change permissions of a directory? > > Well, under UN*X-based systems, the permission changing should work as you > expect with setPermissions() (assuming you have sufficient rights). Under > Windows, though, it probably won't. Windows uses a d

Re: [Interest] Changing permissions in a dir

2014-04-02 Thread Sensei
On 3/31/14, 6:51pm, Thiago Macieira wrote: > Em seg 31 mar 2014, às 13:03:28, Sensei escreveu: >> I am trying to figure out how to change permissions "recursively" of >> every item in a directory. > > Don't use QDir. Use QDirIterator. > > Not only is i

[Interest] Changing permissions in a dir

2014-03-31 Thread Sensei
eUser); if (!b) qWarning("ERR"); } if (info.isDir()) { qWarning("PUSH %s", qPrintable(info.absolutePath())); dirs.push(info.absolutePath()); } } } And this is the o

Re: [Interest] Watching files two ways

2014-03-24 Thread Sensei
On 3/24/14, 2:50pm, alexander golks wrote: >> Right now I can detect if a file changes, and it's ok. However, can I >> track if a file *comes back*? >> >> For instance, if I rename a watched file "a.txt" and rename it to >> "b.txt", I get the slot running. Can I detect if the "b.txt" gets >> rename

[Interest] Watching files two ways

2014-03-24 Thread Sensei
Dear all, I'm using QFileSystemWatcher to watch a list of files, checking for the existence of files. Right now I can detect if a file changes, and it's ok. However, can I track if a file *comes back*? For instance, if I rename a watched file "a.txt" and rename it to "b.txt", I get the slot r

Re: [Interest] First Paint Event: custom shaped widget

2014-02-26 Thread Sensei
Thanks Konstantin, I really thought antialiasing would be turned on by default! Thanks! ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest

[Interest] First Paint Event: custom shaped widget

2014-02-24 Thread Sensei
Dear all, in a previous post (Masked widget glitch) I asked suggestions about making an arrow-like widget (see picture in [1]). The old and bad code used a mask, but it had a glitch, as you see in the picture; however, the workaround was easy: doing show, hide, show. Ugly but it worked. I was

Re: [Interest] QSettings: no settings file

2014-02-24 Thread Sensei
On 19/02/14 17:12, Thiago Macieira wrote: > Em qua 19 fev 2014, às 16:28:59, Sensei escreveu: >> instance_->settings_ = new QSettings(getPreferences() + >> "/0com.example.app", QSettings::NativeFormat); >> >> >> Am I missing something? > >

[Interest] QSettings: no settings file

2014-02-19 Thread Sensei
->setValue("windows_w", QVariant(r.width())); instance_->settings_->setValue("windows_h", QVariant(r.height())); } The output shows correctly this: SAVING TO /Users/sensei/Library/Preferences/0com.example.app However, no file is created there: ls /Users

Re: [Interest] Masked widget glitch

2014-01-17 Thread Sensei
So... no one is experiencing the weird behavior I've posted about? Why is this happening, in your opinion? Cheers! ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest

Re: [Interest] Position of QListWidgetItem

2013-12-17 Thread Sensei
On 12/17/13, 2:40pm, Nurmi J-P wrote: >> I have a simple question: how can I retrieve the coordinates of the current >> QListWidgetItem? I only have access to a QListWidget, and I'd really >> appreciate if I could stick with this very simple widget! :) > > QListWidget::currentItem() and QListWidget

[Interest] Position of QListWidgetItem

2013-12-17 Thread Sensei
Dear all, I have a simple question: how can I retrieve the coordinates of the current QListWidgetItem? I only have access to a QListWidget, and I'd really appreciate if I could stick with this very simple widget! :) Thanks & Cheers! ___ Interest mail

Re: [Interest] A Christmas Toolbar

2013-12-17 Thread Sensei
On 12/16/13, 5:48pm, deDietrich Gabriel wrote: > There are two things here that people tend to mix. If you want a > native Mac toolbar, i.e. all the features of NSToolbar including the > configuration panel and so on, then yes, Qt Mac Extras is the way to > go. If, OTOH, you just want a unified too

Re: [Interest] A Christmas Toolbar

2013-12-17 Thread Sensei
On 12/16/13, 5:41pm, Thiago Macieira wrote: > On segunda-feira, 16 de dezembro de 2013 17:19:22, Sensei wrote: >> Is *still* the qt mac extra a requirement for native toolbars? >> >> If so, is there any prospective whatsoever about bringing an end to this >> external

[Interest] A Christmas Toolbar

2013-12-16 Thread Sensei
Dear all, I just tried the new Qt 5.2 on my mac, but alas, still no "native" toolbar. I might need to start using qt5 soon, so I'd like to avoid having the mac extras between my legs. Is *still* the qt mac extra a requirement for native toolbars? If so, is there any prospective whatsoever abou

Re: [Interest] Glueing widgets together

2013-06-29 Thread Sensei
Yes John, I'm on a Mac. I think you're right. After dumping the whole event chain, I clearly see that events are clustered: if there isn't a delay between them (I am fast and constant dragging the window around), I get only one event when my speed slows down. So there's nothing I can do, right?

Re: [Interest] Glueing widgets together

2013-06-29 Thread Sensei
ne 2013 10:48 PM > > > > On 6/28/13 10:54 AM, Tony Rietwyk wrote: > > > Hi Sensei, > > > > > > I have a master dialog with a slave dialog attached to one border. > > > This was done using eventFilter in the slave to listen to the master > > > Move an

[Interest] Masking an hidden widget (glitch?)

2013-06-28 Thread Sensei
Dear all, I'm trying to avoid sub-classing a widget, because I don't really need it. However, I'd like to apply a mask to it, but I'm looking at a weird behavior. First of all, I don't know how I can apply a mask on a widget that is currently being created (and hidden). If I try to mask it,

[Interest] Glueing widgets together

2013-06-28 Thread Sensei
Dear all, I've posted some time ago a question about moving widgets simultaneously. However, the proposed solutions were unsatisfactory. That is probably because I've expressed my needs in a non useful way. So here it goes. I need to "glue together" two widgets, so that when one moves, the other

Re: [Interest] Place a QWidget below a button (and follow it!)

2013-06-25 Thread Sensei
On 6/13/13 8:38 PM, Andre Somers wrote: > While Bill is right, there is another way that allows you to do this > without changing the main window for it: event filters. That will allow > you to keep all the code you need for this in one place, in the widget > that you want to make move. > > What I'

[Interest] Place a QWidget below a button (and follow it!)

2013-06-13 Thread Sensei
Hi all! I am trying to "attach" a widget to a button inside a main window, making it follow any movement of the entire window. In details, I have a widget that will display a floating window when the user clicks on a QToolButton. This floating widget must be placed below the button that summon

[Interest] QTextEdit line number paint event

2013-06-04 Thread Sensei
Dear all, I modified the QPlainTextEdit example that draws line numbers to suit my taste. What I'd want is simple: display the line number in red if it's the current line, gray otherwise. It turns out, the paint event seems to be not in sync with the current status, leaving unmarked lines or h

Re: [Interest] QRegExp exclamation marks

2013-05-27 Thread Sensei
On 5/27/13 7:25 PM, Thiago Macieira wrote: > On segunda-feira, 27 de maio de 2013 16.48.13, Sensei wrote: >> QRegExp r("\\b(PROGRAM WARNING|!\\s)"); >> >> >> it matches just the second line, not the "! " patterns. > > \b is "word bound

Re: [Interest] QRegExp exclamation marks

2013-05-27 Thread Sensei
On 5/27/13 6:17 PM, Bo Thorsen wrote: > When I do regular expressions for complete lines, I use something like this: > > QRegExp r("^(PROGRAM WARNING|!\\s+)(.*)$"); > > r.cap(1) should be the first part, which you don't need. r.cap(2) should > be the text you are interested in. Thanks, that did t

[Interest] QRegExp exclamation marks

2013-05-27 Thread Sensei
Hi all, this is quite simple, I hope! I am trying to use the regexp application to find all patterns I need before coding. Now, I'd like to match full words that have this patterns: ! This is the text PROGRAM WARNING: This is the text I've come with the following: QRegExp r("PROGRAM WARNING

Re: [Interest] Custom-shaped QDialog or similar

2013-05-22 Thread Sensei
Thanks to both of you for your hints. I am now modifying the Window Flags example, in order to have it my way. For this proof of concept, I am trying to do two things: - Have the custom-shaped window - Move the window where I want: beside the "Quit" button. However, something's wrong here. I

[Interest] Custom-shaped QDialog or similar

2013-05-17 Thread Sensei
Dear all, I'd like to try something new for an application: having a custom shaped dialog for some options. You can see my desire in the attachment. Now, what do you suggest to do that? I am lost here! Using a QDialog maybe? But how can I position it exactly where I'd like? Should this be mo

Re: [Interest] Mac Extras

2013-04-10 Thread Sensei
On 4/10/13 9:36 PM, Danny Price wrote: > I cloned and built the Mac Extras project against Qt 5.0.1 (official > binary) and none of the projects work. The unified toolbar project > also cashes on startup. > > I'm using OSX 10.8 on a very new iMac so it's no my machine. Has > anyone had any success

[Interest] QtMacExtras don't work outside QtMacExtras

2013-04-10 Thread Sensei
Dear all, after the new 5.0.2 update I was eager to give qt5 a try again, and see if QtMacExtras wasn't a bad addition. So I compiled and installed QtMacExtras, all went fine. I've tried from the command line one example, the macunifiedtoolbar one, *from the QtMacExtras directory*. It compiled

[Interest] Moving to smart pointers: recommendations

2013-04-09 Thread Sensei
Dear all, after years of new/delete, I am ready to give smart pointers a try. But I'm quite puzzled about their implementation after reading the awesome "tutorial" (*) by Thiago Macieira. As an example, I ask you guys some recommendations on practical examples. Let's say I am creating some QA

Re: [Interest] QIcons and multithreading

2013-04-05 Thread Sensei
On 4/5/13 1:38pm, Bo Thorsen wrote: > Den 05-04-2013 13:09, Sensei skrev: >> By the way, and just for a thorough exploration of my code, is >> QTreeWidgetItem *without icons* safe to be constructed in a separate >> thread? > > Looking at the source code, it might act

Re: [Interest] QIcons and multithreading

2013-04-05 Thread Sensei
By the way, and just for a thorough exploration of my code, is QTreeWidgetItem *without icons* safe to be constructed in a separate thread? Thanks & Cheers! ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinf

Re: [Interest] QIcons and multithreading

2013-04-05 Thread Sensei
On 4/4/13 6:45pm, Alan Ezust wrote: > The reason, simply, is that the graphics memory and the objects that > reside in it are not thread-safe, and to make them thread-safe would > cause a great performance impact, so Qt doesn't try. > You can read more about this in the documentation, but in genera

Re: [Interest] QIcons and multithreading

2013-04-04 Thread Sensei
On 4/3/13 4:14 PM, Alan Ezust wrote: > no. You can't create widgets or QPixmap in other threads. > > > > The warning is "QPixmap: It is not safe to use pixmaps outside the GUI > thread". > > > Correct. > > > Also, besides QIcons, am I heading for disaster in creating widgets as I >

[Interest] QIcons and multithreading

2013-04-03 Thread Sensei
Dear all, I am using multiple threads in my application, and now I am wondering if I am doing something bad. My application has a 'worker' thread that builds a tree with QTreeWidgetItems, setting QIcons for them. Reading around, I found contradictory information about QPixmap (a warning that

Re: [Interest] QRegExp help: boundaries

2013-03-27 Thread Sensei
On 3/27/13 11:47am, pa...@free.fr wrote: > - Original Message - >> You need to esc the \b. Write \\b instead. > > Hi > > There's a QRegExp tester in the Qt examples. I've always found this > very useful for checking that the regexp is valid and that it does as > expected. It can also produc

[Interest] QRegExp help: boundaries

2013-03-27 Thread Sensei
Dear all, I am trying to use QRegExp to find if a string contains a latex command, but I'm puzzled on how to do that. In particular, for those who don't know latex, commands are (simplifying a lot) words starting with a backslash \ and using curly parentheses {} (and brackets []). For example

Re: [Interest] QMenu: remove icons

2013-03-20 Thread Sensei
On 3/20/13 11:55am, Igor Grivko wrote: > Hi Sensei, > > There is a property in QAction: > iconVisibleInMenu : bool > > I suppose you need to use it. That's it! Thank you very much! ___ Interest mailing list Interest@qt-proj

[Interest] QMenu: remove icons

2013-03-20 Thread Sensei
Dear all, it should be easy, but I didn't find any way to do this. How do I remove icons in a QMenu? More precisely: I add QActions to a menu, and each QAction has an icon. On OSX the standard is NOT to display icons in menus, but only in toolbars. The only way I've found is stupid and cumbers

Re: [Interest] QActionGroup vs QButtonGroup

2013-03-14 Thread Sensei
On 3/12/13 4:28 PM, André Somers wrote: > I think because in this special case, Qt may be be pulling some tricks > to make your application look more native on OS-X. The style may be > using native rendering of the toolbar when you are using a toolbar at > the top of your main window, and fall back

Re: [Interest] QActionGroup vs QButtonGroup

2013-03-12 Thread Sensei
On 3/11/13 3:37 PM, Bill Crocker wrote: > On 03/11/2013 10:06 AM, Sensei wrote: >> On 3/11/13 12:47 PM, Bill Crocker wrote: >>> Wow. A non QML posting. How refreshing. >>> >>> Did you remember to add "/images/console.png" etc. to >>> your

Re: [Interest] QActionGroup vs QButtonGroup

2013-03-11 Thread Sensei
On 3/11/13 12:47 PM, Bill Crocker wrote: > Wow. A non QML posting. How refreshing. > > Did you remember to add "/images/console.png" etc. to > your resources file? Of course, they are using the very same icons, as you can see from the code. One works, the other doesn't. > Also, QIcon is light w

[Interest] QActionGroup vs QButtonGroup

2013-03-11 Thread Sensei
Hi all, I am adding to a toolbar a new set of buttons, checkable and exclusive, but I found a strange behavior. Using a QButtonGroup, buttons are added but NO ICON is showed, while employing the very same icons in a QActionGroup, everything works just fine. I must add, the code using a QButton

[Interest] Styling a single QTreeWidgetItem

2013-03-06 Thread Sensei
Hi all, I don't know if this is possible, but how can I style a single QTreeWidgetItem? In particular, I'd like to make it look like Xcode's root project node, which is "taller" and with borders. (see http://i.stack.imgur.com/gc7ku.png) I've tried to use a custom CSS, but I'm evidently using i

Re: [Interest] Qt 4.8.4: install directory on OSX

2013-03-05 Thread Sensei
On 3/5/13 9:23am, Thiago Macieira wrote: > The Qt libraries installer has never let you select the installation directory > on Mac. The installation was always global. > > You're probably thinking of the SDK installer. We have not released an SDK > installer for Qt 4 since Nokia stopped being part

[Interest] Qt 4.8.4: install directory on OSX

2013-03-05 Thread Sensei
Dear All, this is quite simple. I'm upgrading from qt 4.8.1 to 4.8.5, but this installer does not let me change the default installation directory. Do I have to compile Qt myself from sources? That would be quite annoying. Thanks! ___ Interest mail

Re: [Interest] qApp desktop weirdness

2013-03-01 Thread Sensei
On 3/1/13 3:14pm, Dom wrote: > Hey, > > It seems that the compiler is right. :) > > As QCoreApplication does not have a member called desktop. > But QApplication does! > > http://qt-project.org/doc/qt-4.8/qcoreapplication.html > http://qt-project.org/doc/qt-4.8/qapplication.html > > It was a long t

[Interest] qApp desktop weirdness

2013-03-01 Thread Sensei
p()->geometry(); Of course, the header includes , and I get an error: /Users/sensei/Documents/Projects/htools/hTools/hTools/hSettings.cpp:23:31: error: no member named 'desktop' in 'QCoreApplication' QRect desktop = qApp->desktop()->geometry();

[Interest] QTreeWidget with centered text

2013-02-14 Thread Sensei
Dear all, Do you have suggestions on how to achieve something like the attached image within a class derived from QTreeWidget? I'd just like to have a "Click here" adorned text centered in the widget. My guess was creating a "fake" QTreeWidgetItem and add custom stylesheet, but apparently th

Re: [Interest] Qt5 on MacOS X: State of the Toolbar

2013-01-25 Thread Sensei
On 1/24/13 5:07 PM, Andreas Pakulat wrote: > As far as I understood the qtmacextras module will stay as it is, > except that its going to be released as part of Qt in one of the next > feature releases.So if you don't want to stick to Qt4.8 forever you'll > have to extend your dependencies to inclu

Re: [Interest] Qt5 on MacOS X: State of the Toolbar

2013-01-24 Thread Sensei
On 1/23/13 10:43 AM, Sorvig Morten wrote: > We are getting quite close, the function you are looking for is > > QtMacUnifiedToolBar* setUnifiedTitleAndToolBarOnMac(QToolBar *toolbar, bool > on = true); > > which not far from 4.8's > > QMainWindow::setUnifiedTitleAndToolBarOnMac(bool on) > > (See e

[Interest] Qt5 on MacOS X: State of the Toolbar

2013-01-22 Thread Sensei
Dear all, is there any news on the toolbar on MacOS X? The last news reported that an alternative to setUnifiedTitleAndToolBarOnMac was using an external code as in http://qt.gitorious.org/qtplayground/qtmacextras Is there any planned date (version) to support "native look and feel" as

Re: [Interest] [SOLVED, BUG?] Xcode Script not working with Qt5

2013-01-16 Thread Sensei
On 1/15/13 2:27pm, Sensei wrote: > A sad update on the matter: qmake with Xcode mkspec seems to discard > UIs. I don't know if this classifies as a bug, but at least is seems incoherent. Adding manually "QT += widgets" to the generated .pro project file corrects the prob

Re: [Interest] Xcode Script not working with Qt5

2013-01-15 Thread Sensei
/Development/qt/5.0.0/clang_64/mkspecs/macx-xcode But no mention of UIs are there in the generated Xcode project. Did I miss something? On 1/15/13 1:34pm, Sensei wrote: > Dear all, > > I am moving to Qt 5, developing on my Mac with Xcode. > > My script creates a project, creates a pla

[Interest] Xcode Script not working with Qt5

2013-01-15 Thread Sensei
-I. -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -o qrc_texon.o qrc_texon.cpp Creating library... Since I use forms with generated ui_FILENAME files, I have a compilation error: clang doesn't find a previously gener

Re: [Interest] Never ending thread: blocking GUI

2012-10-16 Thread Sensei
On 10/16/12 3:34pm, Lincoln Ramsay wrote: > You want an async QObject-based interface (call in via slot, answer via > signal). I see what you mean. I went this way and I'm quite happy, so thanks a lot! Here's the awesome output with two different threads! emitting signal on thread 0x7fff7cee618

[Interest] Never ending thread: blocking GUI

2012-10-16 Thread Sensei
Hi! I am in the middle of a crisis, since I thought I understood threads, but I might be wrong! This is quite easy: I want to start a thread that never ends. Once in a while, when the GUI needs it, it will "wake the thread up", and run a method of my QThread subclass, in my case, a "find in fil

Re: [Interest] QMessageBox::critical VS custom: discrepancies

2012-10-08 Thread Sensei
On Monday, October 8, 2012, Christian Kandeler wrote: > > > In one case you give the message box a parent, in the other you do not. > QMessageBox msg(this); > should take care of the screen location difference. > > My bad, I missed the parent. But what about width? There is no kosher way of

[Interest] QMessageBox::critical VS custom: discrepancies

2012-10-08 Thread Sensei
Dear all, I am moving some old QMessageBox::critical (and functions alike) to a Mac-aware UI. This means, according to the documentation, using a more verbose code, with an informative text. However, the widths of the static version VS my custom are quite different. Even more, the location in

[Interest] QLabel with images

2012-09-11 Thread Sensei
Hi all, I need to display a QLabel that has an image and text in it, in particular, a semi-transparent icon. All, without implementing another custom widget. Googling, I found no ways of adding text and images, since one excludes the other. Moreover, my images are black and transparent, used f

[Interest] Creating a grid of icons

2012-09-06 Thread Sensei
Hi again. After trees, now I'm playing with grids. The objective is simple: create a grid of selectable icons (with text below), just like Xcode widget in "New Project". I've tried two approaches: list, and table widget. It's a simple widget, I'd like to avoid very complicated solutions, like

Re: [Interest] Set QTreeWidgetItem style

2012-09-04 Thread Sensei
On 9/4/12 11:37am, Joseph Crowell wrote: > On 9/4/2012 5:59 PM, Sensei wrote: >> Dear all, >> >> as usual, I am playing with tree widgets. Now I'm facing this problem: >> >> Is it possible to set CSS styles on some widget items? For example, >> ite

[Interest] Set QTreeWidgetItem style

2012-09-04 Thread Sensei
Dear all, as usual, I am playing with tree widgets. Now I'm facing this problem: Is it possible to set CSS styles on some widget items? For example, items that have no valid parent, or items named "foobar". Thanks! ___ Interest mailing list Interest@

Re: [Interest] Reading trees from QSettings

2012-08-31 Thread Sensei
On 8/30/12 8:22pm, BRM wrote: > [...] Forward thinking is usually very good in software as long as > one holds the reigns in tight so as not to over-engineer for things > that will never happen (like adding audio support to an image file). Thanks, you have been very thorough. Thanks again! __

Re: [Interest] Reading trees from QSettings

2012-08-30 Thread Sensei
On 8/30/12 4:39pm, BRM wrote: > I'm saying to do something like: > > [Root] > item\1\name=New File > item\1\isFile=true > item\2\name=New Folder > item\2\isFile=false > item\size=2 > > [New%20Folder] > item\1\name= > item\1\isFile=false > item\size=1 > > No QStringList is required, and it's ver

Re: [Interest] Reading trees from QSettings

2012-08-30 Thread Sensei
On 8/30/12 3:37pm, BRM wrote: > While I don't know if there is a "safe way to [query] for an existing > group", I'd suggest that you just give yourself another key as part > of the array to identify it as either a file or group. I've tried that, and I've found that the problem is in calling QSetti

Re: [Interest] Weird QSettings/QStringList? Was: Reading trees from QSettings

2012-08-30 Thread Sensei
Regarding this problem, I've found a way around. It is a nasty way around, but it works. I've added some warnings, and adding a new variable, a QStringList constructed from the QSettings: QStringList sons = s.childGroups(); In the loop, I check if a group exists, with a call to QSettings

[Interest] Reading trees from QSettings

2012-08-30 Thread Sensei
Hi again! As you remember, I was playing with QTreeWidget items, now I'd like to write and read the tree (a strict tree) from QSettings. I can write the tree easily, for example the following tree has a file, and a folder; the folder has a file inside. [Root] item\1\name=New File item\2\name=N

Re: [Interest] Tree widget: rearrange elements

2012-08-29 Thread Sensei
On 8/29/12 11:53am, Jan Kundrát wrote: > That's because root.parent() is an invalid index, and your code > explicitly rejects such drops. Try changing the else branch to > explicitly test for indexAt(event->pos()) == root and accept such events. Cool, now I get root to accept drops! Thanks!

Re: [Interest] Tree widget: rearrange elements

2012-08-29 Thread Sensei
On 8/29/12 10:53am, Tibold Kandrai wrote: > Hi, > > You can try to set flags on the invisibleRootItem: > http://doc.qt.nokia.com/4.7-snapshot/qstandarditemmodel.html#invisibleRootItem > > I never used this, but it worth a try. :) It would be cool, but it doesn't work... invisibleRootItem()-

Re: [Interest] Tree widget: rearrange elements

2012-08-29 Thread Sensei
On 8/27/12 12:37pm, Tibold Kandrai wrote: > Hi, > > Nice catch! > > Set the flag since that you have to do that only when creating the item > and I guess Qt internally it will check the flag anyway. Hi again! Having succeeded in this, now I'm facing a new challenge: limit the drop to a tree. I

Re: [Interest] Tree widget: rearrange elements

2012-08-27 Thread Sensei
On 8/27/12 10:59am, Tibold Kandrai wrote: > Hi, > > As I understood the task is this: > You want Qt to handle the drag and drop, but you want to control whether > you can or cannot drop the item. > > For this you need to override one of the drag events not the drop event. > I think you need to use

[Interest] Tree widget: rearrange elements

2012-08-27 Thread Sensei
Dear all, I am now messing around my own QTreeWidget. I'm trying to let rearrangement of items possible, allowing or disallowing drop events. Obviously it doesn't work, otherwise I wouldn't seek your help! :) Test case: in a tree there are "folders" and "files", and I can move files on folders

Re: [Interest] QSettings: is a group present? Crash with qWarning.

2012-08-24 Thread Sensei
On 8/24/12 11:45am, Till Oliver Knoll wrote: > Am 24.08.2012 um 11:00 schrieb Sensei: > >>> ... >> >> Yep, as a matter of fact I ignored several compiler warnings. They >> all refer to QVector: > > You cheeky boy, you! ;) They weren't harmful, the

Re: [Interest] QSettings: is a group present? Crash with qWarning.

2012-08-24 Thread Sensei
On 8/24/12 8:59am, Thiago Macieira wrote: >> So there's a "bug" in the docs... am I right? > > No. It's not a bug if it's intentional. > > QBool is a hidden class that is actually a bool. In most cases, you don't > realise it's there because it casts automatically to bool. The two cases that > it w

Re: [Interest] QSettings: is a group present? Crash with qWarning.

2012-08-23 Thread Sensei
On 8/23/12 5:21pm, Samuel Gaist wrote: > Hi, > > Looks like your on mac, trying on mine I get this at compilation time: > > warning: cannot pass objects of non-POD type 'class QBool' through '...'; > call will abort at runtime > > Here is the why of your crash > > Hope it helps Samuel, it help,

[Interest] QSettings: is a group present? Crash with qWarning.

2012-08-23 Thread Sensei
hy this crashes when used inside a qWarning. This is the very simple INI file: [first] item=2 [last] size=1 This is the super simple code I've written: #include #include int main(int argc, char *argv[]) { QSettings s("/Users/sensei/Desktop/proj.txp", QSe

Re: [Interest] Text editor's line numbers: misalignment

2012-08-22 Thread Sensei
On 8/22/12 10:09am, Diego Iastrubni wrote: > 1) use the same font for the line number as the text editor - > > or > > 2) set the hight of each line in the panel, as the hight of each line in > the editor. > Actually, that is what the code from Qt does. It wouldn't explain why the code works with

[Interest] Text editor's line numbers: misalignment

2012-08-22 Thread Sensei
Hi all, I've got a question about QPlainTextEdit, adding line numbers. I've been following the Qt example in http://qt-project.org/doc/qt-4.8/widgets-codeeditor.html, but I am experiencing a *very weird* problem. The only difference with the code above is in the constructor, as you can see in t

[Interest] Adding button groups to toolbars?

2012-05-29 Thread Sensei
Hi everyone, I have (another) problem. I am trying to mimick the layout of Xcode, making a simple custom widget with a toolbar on top and a widget on the bottom. I was able to create a vertical layout and add a series of actions, adding them to the toolbar. Now I was moving to the next level:

Re: [Interest] Toolbar size and icon color

2012-05-24 Thread Sensei
On 5/23/12 4:12 PM, Konstantin Tokarev wrote: > > You can set up any icon pairs for active and inactive states. > I am trying to make this pair work... without success. For simplicity, I am using one pixmap, inverting its colors. This is my code: QImage dir("image.png"); QImage inv(d

Re: [Interest] Toolbar size and icon color

2012-05-23 Thread Sensei
On 5/23/12 5:02pm, Bill Crocker wrote: > This works for me: > > void > MyApp::setAllIconSizes( QSize sz ) { > foreach( QWidget *wp, qApp->topLevelWidgets() ) { > foreach( QToolBar *bp, wp->findChildren() ) { > bp->setIconSize( sz ); > } > foreach(

Re: [Interest] Toolbar size and icon color

2012-05-23 Thread Sensei
On 5/23/12 4:12pm, Konstantin Tokarev wrote: > Are your icons large enough for your size? They won't be scaled up. Actually, I'm trying to use smaller icons. I have the original 60x60 icons, and I scaled them to 48, 36, and 28. I'd like to see which size is visually better. However, I always e

[Interest] Toolbar size and icon color

2012-05-23 Thread Sensei
Dear all, I'd like to create a toolbar for a main window, customizing it. However, using setIconSize isn't affecting the toolbar size or the icons in it. Am I trying hopelessly? Another related topic is this: is it possible to use black icons? The reason I'm asking this possibly naive question

Re: [Interest] Creating an aux library

2012-05-23 Thread Sensei
On 5/22/12 7:12pm, Till Oliver Knoll wrote: > Don't you have the same problem (how to automate the moc/ui step > within XCode) when building an executable? Well, if I simply use a text editor, I'd rely on the console. That would be "automated" by qmake. However, with Xcode, things might get easi

[Interest] Creating an aux library

2012-05-22 Thread Sensei
Dear all, I am developing applications on my Mac, using Xcode. Now, I'd like to make things smooth, using the most of Xcode, and using qmake for just the things I need. What am I missing right now? MOCs and UIs. How can I create a (static) library from MOCs and UI's header/source files? Right