- neoGFX automatic UI code generation - 3 Updates
- [QT creator free, on "nix"], about NULL, nullptr etc - 5 Updates
- Substitution failure can be an error - 7 Updates
- Where are the exception-objects allocated? - 3 Updates
- std::atomic<T>::is_lock_free() - 1 Update
| Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 19 11:03PM Hi! Here is a taste (actual output which compiles) of what neoGFX auto code gen looks like (the UI is described using a variant of "Relaxed JSON"):- // This is an automatically generated file, do not edit! #include <neogfx/neogfx.hpp> #include <neogfx/app/action.hpp> #include <neogfx/app/app.hpp> #include <neogfx/gui/widget/menu.hpp> #include <neogfx/gui/widget/menu_bar.hpp> #include <neogfx/gui/widget/status_bar.hpp> #include <neogfx/gui/widget/tab_page.hpp> #include <neogfx/gui/widget/tab_page_container.hpp> #include <neogfx/gui/widget/toolbar.hpp> #include <neogfx/gui/window/window.hpp> namespace test { using namespace neogfx; using namespace neogfx::unit_literals; struct ui { app appTest; action actionGoldenrodStyle; action actionContacts; action actionAddFavourite; action actionOrganizeFavourites; action actionMute; action actionPasteAndGo; window mainWindow; status_bar statusBar; menu_bar menuBar; menu menuBar_1; nrc::action_ref menuBar_1_1; nrc::action_ref menuBar_1_2; nrc::action_ref menuBar_1_3; nrc::action_ref menuBar_1_4; nrc::action_ref menuBar_1_5; nrc::action_ref menuBar_1_6; nrc::action_ref menuBar_1_7; nrc::action_ref menuBar_1_8; menu menuBar_2; nrc::action_ref menuBar_2_1; nrc::action_ref menuBar_2_2; nrc::action_ref menuBar_2_3; nrc::action_ref menuBar_2_4; nrc::action_ref menuBar_2_5; nrc::action_ref menuBar_2_6; nrc::action_ref menuBar_2_7; nrc::action_ref menuBar_2_8; nrc::action_ref menuBar_2_9; nrc::action_ref menuBar_2_10; menu menuBar_3; menu menuFavourites; nrc::action_ref menuFavourites_1; nrc::action_ref menuFavourites_2; nrc::action_ref menuFavourites_3; action menuFavourites_4; action menuFavourites_5; action menuFavourites_6; action menuFavourites_7; menu menuFavourites_8; action menuFavourites_8_1; action menuFavourites_8_2; action menuFavourites_8_3; menu menuFavourites_9; menu menuFavourites_10; nrc::action_ref menuFavourites_11; nrc::action_ref menuBar_4; nrc::action_ref menuBar_5; action menuBar_6; menu menuTest; action actionEmacsStyleSequence1; action actionEmacsStyleSequence2; nrc::action_ref menuTest_1; nrc::action_ref menuTest_2; nrc::action_ref menuTest_3; nrc::action_ref menuTest_4; nrc::action_ref menuTest_5; action actionColourDialog; menu menuWindow; action actionNextTab; action actionPreviousTab; menu menuHelp; toolbar toolbarTest; nrc::action_ref toolbarTest_1; nrc::action_ref toolbarTest_2; nrc::action_ref toolbarTest_3; nrc::action_ref toolbarTest_4; nrc::action_ref toolbarTest_5; nrc::action_ref toolbarTest_6; nrc::action_ref toolbarTest_7; action toolbarTest_8; action toolbarTest_9; action actionManagePlugins; nrc::action_ref toolbarTest_10; nrc::action_ref toolbarTest_11; nrc::action_ref toolbarTest_12; nrc::action_ref toolbarTest_13; nrc::action_ref toolbarTest_14; nrc::action_ref toolbarTest_15; nrc::action_ref toolbarTest_16; action actionCheckForUpdates; tab_page_container tabPages; tab_page pageButtons; tab_page pageMdi; tab_page pageMessageBox; tab_page pageItemViews; tab_page pageLots; tab_page pageImages; tab_page pageGame; tab_page pageDrawing; tab_page pageEditor; tab_page pageCircles; tab_page pageFoo; tab_page pageBar; ui(int argc, char* argv[]) : appTest{ argc, argv, "neoGFX Test App (Pre-Release)", image{ ":/test/resources/icon.png" } }, actionGoldenrodStyle{ "Goldenrod Style"_t }, actionContacts{ "&Contacts..."_t }, actionAddFavourite{ "Add Favourite..."_t }, actionOrganizeFavourites{ "Organize Favourites..."_t }, actionMute{ "Mute/&Unmute Sound"_t }, actionPasteAndGo{ "Paste and Go"_t }, mainWindow{ size{ 800_spx, 800_spx } }, statusBar{ mainWindow.status_bar_layout() }, menuBar{ mainWindow.menu_layout() }, menuBar_1{ menuBar, menu_type::Popup, "&File"_t }, menuBar_1_1{ menuBar_1, appTest.actionFileNew }, menuBar_1_2{ menuBar_1, appTest.actionFileOpen }, menuBar_1_3{ menuBar_1 }, menuBar_1_4{ menuBar_1, appTest.actionFileClose }, menuBar_1_5{ menuBar_1 }, menuBar_1_6{ menuBar_1, appTest.actionFileSave }, menuBar_1_7{ menuBar_1 }, menuBar_1_8{ menuBar_1, appTest.actionFileExit }, menuBar_2{ menuBar, menu_type::Popup, "&Edit"_t }, menuBar_2_1{ menuBar_2, appTest.actionUndo }, menuBar_2_2{ menuBar_2, appTest.actionRedo }, menuBar_2_3{ menuBar_2 }, menuBar_2_4{ menuBar_2, appTest.actionCut }, menuBar_2_5{ menuBar_2, appTest.actionCopy }, menuBar_2_6{ menuBar_2, appTest.actionPaste }, menuBar_2_7{ menuBar_2, actionPasteAndGo }, menuBar_2_8{ menuBar_2, appTest.actionDelete }, menuBar_2_9{ menuBar_2 }, menuBar_2_10{ menuBar_2, appTest.actionSelectAll }, menuBar_3{ menuBar, menu_type::Popup, "&View"_t }, menuFavourites{ menuBar, menu_type::Popup, "F&avourites"_t }, menuFavourites_1{ menuFavourites, actionAddFavourite }, menuFavourites_2{ menuFavourites, actionOrganizeFavourites }, menuFavourites_3{ menuFavourites }, menuFavourites_4{ menuFavourites, "Alice"_t }, menuFavourites_5{ menuFavourites, "Bob"_t }, menuFavourites_6{ menuFavourites, "Carlos"_t }, menuFavourites_7{ menuFavourites, "Dave"_t }, menuFavourites_8{ menuFavourites, menu_type::Popup, "Silent Running Drones"_t }, menuFavourites_8_1{ menuFavourites_8, "Dewey"_t }, menuFavourites_8_2{ menuFavourites_8, "Huey"_t }, menuFavourites_8_3{ menuFavourites_8, "Louie"_t }, menuFavourites_9{ menuFavourites, menu_type::Popup, "DC (TM) Characters"_t }, menuFavourites_10{ menuFavourites, menu_type::Popup, "Marvel (TM) Characters"_t }, menuFavourites_11{ menuFavourites }, menuBar_4{ menuBar, actionContacts }, menuBar_5{ menuBar, actionMute }, menuBar_6{ "&Xyzzy..."_t }, menuTest{ menuBar, menu_type::Popup, "&Test"_t }, actionEmacsStyleSequence1{ menuTest, "Emacs style sequence #1"_t }, actionEmacsStyleSequence2{ menuTest, "Emacs style sequence #2"_t }, menuTest_1{ menuTest, actionContacts }, menuTest_2{ menuTest, actionMute }, menuTest_3{ menuTest, actionMute }, menuTest_4{ menuTest, actionMute }, menuTest_5{ menuTest, actionMute }, actionColourDialog{ menuTest, "Colour Dialog..."_t }, menuWindow{ menuBar, menu_type::Popup, "&Window"_t }, actionNextTab{ menuWindow, "Next Tab"_t }, actionPreviousTab{ menuWindow, "Previous Tab"_t }, menuHelp{ menuBar, menu_type::Popup, "&Help"_t }, toolbarTest{ mainWindow.toolbar_layout() }, toolbarTest_1{ toolbarTest, appTest.actionFileNew }, toolbarTest_2{ toolbarTest, appTest.actionFileOpen }, toolbarTest_3{ toolbarTest, appTest.actionFileSave }, toolbarTest_4{ toolbarTest }, toolbarTest_5{ toolbarTest, actionContacts }, toolbarTest_6{ toolbarTest, actionAddFavourite }, toolbarTest_7{ toolbarTest, actionOrganizeFavourites }, toolbarTest_8{ "Keywords..."_t }, toolbarTest_9{ "Settings..."_t }, actionManagePlugins{ "Manage Plugins..."_t }, toolbarTest_10{ toolbarTest, actionMute }, toolbarTest_11{ toolbarTest }, toolbarTest_12{ toolbarTest, appTest.actionCut }, toolbarTest_13{ toolbarTest, appTest.actionCopy }, toolbarTest_14{ toolbarTest, appTest.actionPaste }, toolbarTest_15{ toolbarTest, actionPasteAndGo }, toolbarTest_16{ toolbarTest }, actionCheckForUpdates{ "Check for Updates..."_t }, tabPages{ mainWindow.client_layout(), true }, pageButtons{ tabPages, "Buttons"_t }, pageMdi{ tabPages, "MDI"_t }, pageMessageBox{ tabPages, "Message Boxes"_t }, pageItemViews{ tabPages, "Item Views"_t }, pageLots{ tabPages, "Lots"_t }, pageImages{ tabPages, "Images"_t }, pageGame{ tabPages, "Game"_t }, pageDrawing{ tabPages, "Drawing"_t }, pageEditor{ tabPages, "Editor"_t }, pageCircles{ tabPages, "Circles"_t }, pageFoo{ tabPages, "Foo"_t }, pageBar{ tabPages, "Bar"_t } { actionGoldenrodStyle.set_checkable(false); actionGoldenrodStyle.set_shortcut("Ctrl+Alt+Shift+G"); actionContacts.set_checkable(false); actionContacts.set_image(":/closed/resources/caw_toolbar.naa#contacts.png"); actionContacts.set_shortcut("Alt+C"); actionAddFavourite.set_checkable(false); actionAddFavourite.set_image(":/closed/resources/caw_toolbar.naa#add_favourite.png"); actionOrganizeFavourites.set_checkable(false); actionOrganizeFavourites.set_image(":/closed/resources/caw_toolbar.naa#organize_favourites.png"); actionOrganizeFavourites.set_shortcut("Alt+C"); actionMute.set_checkable(true); actionMute.set_image(":/closed/resources/caw_toolbar.naa#mute.png"); actionMute.set_checked_image(":/closed/resources/caw_toolbar.naa#unmute.png"); actionPasteAndGo.set_checkable(false); actionPasteAndGo.set_image(":/closed/resources/caw_toolbar.naa#paste_and_go.png"); actionPasteAndGo.set_shortcut("Ctrl+Shift+V"); menuFavourites_4.set_checkable(false); menuFavourites_4.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_5.set_checkable(false); menuFavourites_5.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_6.set_checkable(false); menuFavourites_6.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_7.set_checkable(false); menuFavourites_7.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_8_1.set_checkable(false); menuFavourites_8_1.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_8_2.set_checkable(false); menuFavourites_8_2.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_8_3.set_checkable(false); menuFavourites_8_3.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuBar_6.set_checkable(false); menuBar_6.set_image(":/neogfx/resources/icons.naa#eyedropper.png"); actionEmacsStyleSequence1.set_checkable(false); actionEmacsStyleSequence1.set_shortcut("Ctrl+K, Ctrl+B"); actionEmacsStyleSequence2.set_checkable(false); actionEmacsStyleSequence2.set_shortcut("Ctrl+K, Ctrl+K"); actionColourDialog.set_checkable(false); actionNextTab.set_checkable(false); actionNextTab.set_shortcut("Ctrl+Tab"); actionPreviousTab.set_checkable(false); actionPreviousTab.set_shortcut("Shift+Ctrl+Tab"); toolbarTest_8.set_checkable(false); toolbarTest_8.set_image(":/closed/resources/caw_toolbar.naa#keyword.png"); toolbarTest_9.set_checkable(false); toolbarTest_9.set_image(":/closed/resources/caw_toolbar.naa#settings.png"); actionManagePlugins.set_checkable(false); actionManagePlugins.set_image(":/closed/resources/caw_toolbar.naa#manage_plugins.png"); actionCheckForUpdates.set_checkable(false); actionCheckForUpdates.set_image(":/closed/resources/caw_toolbar.naa#setup.png"); pageFoo.tab().set_image(image{ ":/test/resources/channel.png" }); pageBar.tab().set_image(image{ ":/test/resources/channel.png" }); } }; } /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
| Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 19 11:05PM On 19/11/2019 23:03, Mr Flibble wrote: > actionCheckForUpdates.set_checkable(false); > actionCheckForUpdates.set_image(":/closed/resources/caw_toolbar.naa#setup.png"); > pageFoo.tab().set_image(image{ ":/test/resources/channel.png" It is really annoying how Thunderbird wraps lines like that. /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
| Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Nov 19 11:10PM On 19/11/2019 23:05, Mr Flibble wrote: >> pageFoo.tab().set_image(image{ ":/test/resources/channel.png" > It is really annoying how Thunderbird wraps lines like that. > /Flibble Again: // This is an automatically generated file, do not edit! #include <neogfx/neogfx.hpp> #include <neogfx/app/action.hpp> #include <neogfx/app/app.hpp> #include <neogfx/gui/widget/menu.hpp> #include <neogfx/gui/widget/menu_bar.hpp> #include <neogfx/gui/widget/status_bar.hpp> #include <neogfx/gui/widget/tab_page.hpp> #include <neogfx/gui/widget/tab_page_container.hpp> #include <neogfx/gui/widget/toolbar.hpp> #include <neogfx/gui/window/window.hpp> namespace test { using namespace neogfx; using namespace neogfx::unit_literals; struct ui { app appTest; action actionGoldenrodStyle; action actionContacts; action actionAddFavourite; action actionOrganizeFavourites; action actionMute; action actionPasteAndGo; window mainWindow; status_bar statusBar; menu_bar menuBar; menu menuBar_1; nrc::action_ref menuBar_1_1; nrc::action_ref menuBar_1_2; nrc::action_ref menuBar_1_3; nrc::action_ref menuBar_1_4; nrc::action_ref menuBar_1_5; nrc::action_ref menuBar_1_6; nrc::action_ref menuBar_1_7; nrc::action_ref menuBar_1_8; menu menuBar_2; nrc::action_ref menuBar_2_1; nrc::action_ref menuBar_2_2; nrc::action_ref menuBar_2_3; nrc::action_ref menuBar_2_4; nrc::action_ref menuBar_2_5; nrc::action_ref menuBar_2_6; nrc::action_ref menuBar_2_7; nrc::action_ref menuBar_2_8; nrc::action_ref menuBar_2_9; nrc::action_ref menuBar_2_10; menu menuBar_3; menu menuFavourites; nrc::action_ref menuFavourites_1; nrc::action_ref menuFavourites_2; nrc::action_ref menuFavourites_3; action menuFavourites_4; action menuFavourites_5; action menuFavourites_6; action menuFavourites_7; menu menuFavourites_8; action menuFavourites_8_1; action menuFavourites_8_2; action menuFavourites_8_3; menu menuFavourites_9; menu menuFavourites_10; nrc::action_ref menuFavourites_11; nrc::action_ref menuBar_4; nrc::action_ref menuBar_5; action menuBar_6; menu menuTest; action actionEmacsStyleSequence1; action actionEmacsStyleSequence2; nrc::action_ref menuTest_1; nrc::action_ref menuTest_2; nrc::action_ref menuTest_3; nrc::action_ref menuTest_4; nrc::action_ref menuTest_5; action actionColourDialog; menu menuWindow; action actionNextTab; action actionPreviousTab; menu menuHelp; toolbar toolbarTest; nrc::action_ref toolbarTest_1; nrc::action_ref toolbarTest_2; nrc::action_ref toolbarTest_3; nrc::action_ref toolbarTest_4; nrc::action_ref toolbarTest_5; nrc::action_ref toolbarTest_6; nrc::action_ref toolbarTest_7; action toolbarTest_8; action toolbarTest_9; action actionManagePlugins; nrc::action_ref toolbarTest_10; nrc::action_ref toolbarTest_11; nrc::action_ref toolbarTest_12; nrc::action_ref toolbarTest_13; nrc::action_ref toolbarTest_14; nrc::action_ref toolbarTest_15; nrc::action_ref toolbarTest_16; action actionCheckForUpdates; tab_page_container tabPages; tab_page pageButtons; tab_page pageMdi; tab_page pageMessageBox; tab_page pageItemViews; tab_page pageLots; tab_page pageImages; tab_page pageGame; tab_page pageDrawing; tab_page pageEditor; tab_page pageCircles; tab_page pageFoo; tab_page pageBar; ui(int argc, char* argv[]) : appTest{ argc, argv, "neoGFX Test App (Pre-Release)", image{ ":/test/resources/icon.png" } }, actionGoldenrodStyle{ "Goldenrod Style"_t }, actionContacts{ "&Contacts..."_t }, actionAddFavourite{ "Add Favourite..."_t }, actionOrganizeFavourites{ "Organize Favourites..."_t }, actionMute{ "Mute/&Unmute Sound"_t }, actionPasteAndGo{ "Paste and Go"_t }, mainWindow{ size{ 800_spx, 800_spx } }, statusBar{ mainWindow.status_bar_layout() }, menuBar{ mainWindow.menu_layout() }, menuBar_1{ menuBar, menu_type::Popup, "&File"_t }, menuBar_1_1{ menuBar_1, appTest.actionFileNew }, menuBar_1_2{ menuBar_1, appTest.actionFileOpen }, menuBar_1_3{ menuBar_1 }, menuBar_1_4{ menuBar_1, appTest.actionFileClose }, menuBar_1_5{ menuBar_1 }, menuBar_1_6{ menuBar_1, appTest.actionFileSave }, menuBar_1_7{ menuBar_1 }, menuBar_1_8{ menuBar_1, appTest.actionFileExit }, menuBar_2{ menuBar, menu_type::Popup, "&Edit"_t }, menuBar_2_1{ menuBar_2, appTest.actionUndo }, menuBar_2_2{ menuBar_2, appTest.actionRedo }, menuBar_2_3{ menuBar_2 }, menuBar_2_4{ menuBar_2, appTest.actionCut }, menuBar_2_5{ menuBar_2, appTest.actionCopy }, menuBar_2_6{ menuBar_2, appTest.actionPaste }, menuBar_2_7{ menuBar_2, actionPasteAndGo }, menuBar_2_8{ menuBar_2, appTest.actionDelete }, menuBar_2_9{ menuBar_2 }, menuBar_2_10{ menuBar_2, appTest.actionSelectAll }, menuBar_3{ menuBar, menu_type::Popup, "&View"_t }, menuFavourites{ menuBar, menu_type::Popup, "F&avourites"_t }, menuFavourites_1{ menuFavourites, actionAddFavourite }, menuFavourites_2{ menuFavourites, actionOrganizeFavourites }, menuFavourites_3{ menuFavourites }, menuFavourites_4{ menuFavourites, "Alice"_t }, menuFavourites_5{ menuFavourites, "Bob"_t }, menuFavourites_6{ menuFavourites, "Carlos"_t }, menuFavourites_7{ menuFavourites, "Dave"_t }, menuFavourites_8{ menuFavourites, menu_type::Popup, "Silent Running Drones"_t }, menuFavourites_8_1{ menuFavourites_8, "Dewey"_t }, menuFavourites_8_2{ menuFavourites_8, "Huey"_t }, menuFavourites_8_3{ menuFavourites_8, "Louie"_t }, menuFavourites_9{ menuFavourites, menu_type::Popup, "DC (TM) Characters"_t }, menuFavourites_10{ menuFavourites, menu_type::Popup, "Marvel (TM) Characters"_t }, menuFavourites_11{ menuFavourites }, menuBar_4{ menuBar, actionContacts }, menuBar_5{ menuBar, actionMute }, menuBar_6{ "&Xyzzy..."_t }, menuTest{ menuBar, menu_type::Popup, "&Test"_t }, actionEmacsStyleSequence1{ menuTest, "Emacs style sequence #1"_t }, actionEmacsStyleSequence2{ menuTest, "Emacs style sequence #2"_t }, menuTest_1{ menuTest, actionContacts }, menuTest_2{ menuTest, actionMute }, menuTest_3{ menuTest, actionMute }, menuTest_4{ menuTest, actionMute }, menuTest_5{ menuTest, actionMute }, actionColourDialog{ menuTest, "Colour Dialog..."_t }, menuWindow{ menuBar, menu_type::Popup, "&Window"_t }, actionNextTab{ menuWindow, "Next Tab"_t }, actionPreviousTab{ menuWindow, "Previous Tab"_t }, menuHelp{ menuBar, menu_type::Popup, "&Help"_t }, toolbarTest{ mainWindow.toolbar_layout() }, toolbarTest_1{ toolbarTest, appTest.actionFileNew }, toolbarTest_2{ toolbarTest, appTest.actionFileOpen }, toolbarTest_3{ toolbarTest, appTest.actionFileSave }, toolbarTest_4{ toolbarTest }, toolbarTest_5{ toolbarTest, actionContacts }, toolbarTest_6{ toolbarTest, actionAddFavourite }, toolbarTest_7{ toolbarTest, actionOrganizeFavourites }, toolbarTest_8{ "Keywords..."_t }, toolbarTest_9{ "Settings..."_t }, actionManagePlugins{ "Manage Plugins..."_t }, toolbarTest_10{ toolbarTest, actionMute }, toolbarTest_11{ toolbarTest }, toolbarTest_12{ toolbarTest, appTest.actionCut }, toolbarTest_13{ toolbarTest, appTest.actionCopy }, toolbarTest_14{ toolbarTest, appTest.actionPaste }, toolbarTest_15{ toolbarTest, actionPasteAndGo }, toolbarTest_16{ toolbarTest }, actionCheckForUpdates{ "Check for Updates..."_t }, tabPages{ mainWindow.client_layout(), true }, pageButtons{ tabPages, "Buttons"_t }, pageMdi{ tabPages, "MDI"_t }, pageMessageBox{ tabPages, "Message Boxes"_t }, pageItemViews{ tabPages, "Item Views"_t }, pageLots{ tabPages, "Lots"_t }, pageImages{ tabPages, "Images"_t }, pageGame{ tabPages, "Game"_t }, pageDrawing{ tabPages, "Drawing"_t }, pageEditor{ tabPages, "Editor"_t }, pageCircles{ tabPages, "Circles"_t }, pageFoo{ tabPages, "Foo"_t }, pageBar{ tabPages, "Bar"_t } { actionGoldenrodStyle.set_checkable(false); actionGoldenrodStyle.set_shortcut("Ctrl+Alt+Shift+G"); actionContacts.set_checkable(false); actionContacts.set_image(":/closed/resources/caw_toolbar.naa#contacts.png"); actionContacts.set_shortcut("Alt+C"); actionAddFavourite.set_checkable(false); actionAddFavourite.set_image(":/closed/resources/caw_toolbar.naa#add_favourite.png"); actionOrganizeFavourites.set_checkable(false); actionOrganizeFavourites.set_image(":/closed/resources/caw_toolbar.naa#organize_favourites.png"); actionOrganizeFavourites.set_shortcut("Alt+C"); actionMute.set_checkable(true); actionMute.set_image(":/closed/resources/caw_toolbar.naa#mute.png"); actionMute.set_checked_image(":/closed/resources/caw_toolbar.naa#unmute.png"); actionPasteAndGo.set_checkable(false); actionPasteAndGo.set_image(":/closed/resources/caw_toolbar.naa#paste_and_go.png"); actionPasteAndGo.set_shortcut("Ctrl+Shift+V"); menuFavourites_4.set_checkable(false); menuFavourites_4.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_5.set_checkable(false); menuFavourites_5.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_6.set_checkable(false); menuFavourites_6.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_7.set_checkable(false); menuFavourites_7.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_8_1.set_checkable(false); menuFavourites_8_1.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_8_2.set_checkable(false); menuFavourites_8_2.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuFavourites_8_3.set_checkable(false); menuFavourites_8_3.set_image(":/closed/resources/caw_toolbar.naa#favourite.png"); menuBar_6.set_checkable(false); menuBar_6.set_image(":/neogfx/resources/icons.naa#eyedropper.png"); actionEmacsStyleSequence1.set_checkable(false); actionEmacsStyleSequence1.set_shortcut("Ctrl+K, Ctrl+B"); actionEmacsStyleSequence2.set_checkable(false); actionEmacsStyleSequence2.set_shortcut("Ctrl+K, Ctrl+K"); actionColourDialog.set_checkable(false); actionNextTab.set_checkable(false); actionNextTab.set_shortcut("Ctrl+Tab"); actionPreviousTab.set_checkable(false); actionPreviousTab.set_shortcut("Shift+Ctrl+Tab"); toolbarTest_8.set_checkable(false); toolbarTest_8.set_image(":/closed/resources/caw_toolbar.naa#keyword.png"); toolbarTest_9.set_checkable(false); toolbarTest_9.set_image(":/closed/resources/caw_toolbar.naa#settings.png"); actionManagePlugins.set_checkable(false); actionManagePlugins.set_image(":/closed/resources/caw_toolbar.naa#manage_plugins.png"); actionCheckForUpdates.set_checkable(false); actionCheckForUpdates.set_image(":/closed/resources/caw_toolbar.naa#setup.png"); pageFoo.tab().set_image(image{ ":/test/resources/channel.png" }); pageBar.tab().set_image(image{ ":/test/resources/channel.png" }); } }; } /Flibble -- "Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin "You won't burn in hell. But be nice anyway." – Ricky Gervais "I see Atheists are fighting and killing each other again, over who doesn't believe in any God the most. Oh, no..wait.. that never happens." – Ricky Gervais "Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?" "I'd say, bone cancer in children? What's that about?" Fry replied. "How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil." "Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say." |
| Soviet_Mario <SovietMario@CCCP.MIR>: Nov 19 08:49PM +0100 I still sometimes write C-like casts like if (MyPointer == (classPincoPallo *)(0)) {} then QT ide slams me for "old styled" fashion, so I rewrite if (MyPointer == static_cast <classPincoPallo *> (0)) {} and it again complaints until i correct further to if (MyPointer == static_cast <classPincoPallo *> (nullptr)) {} now, WHAT exactly is the nullptr ? Is it really different from ZERO (all-zeroes-bit pattern of the word size) ? If it is a zero, why the ide complaints as it was just casted in a zero of a proper type ? if it is not zero, is it some "system-dependent" numeric constant ? Why should it better than zero ? Is it a bigger than bigger ram address value ? I'm confused about the pointer "nullity" management. Long ago casting a 0 had been enough :\ -- 1) Resistere, resistere, resistere. 2) Se tutti pagano le tasse, le tasse le pagano tutti Soviet_Mario - (aka Gatto_Vizzato) |
| Bo Persson <bo@bo-persson.se>: Nov 19 09:38PM +0100 On 2019-11-19 at 20:49, Soviet_Mario wrote: > Is it a bigger than bigger ram address value ? > I'm confused about the pointer "nullity" management. > Long ago casting a 0 had been enough :\ The nullptr is just a literal for a null pointer, of any pointer type. Absolutely no reason to cast it to anything - it already is of that pointer type (and all others as well). Also, to be predantic, the null pointer doesn't have to be all-zero-bits if the system prefers some other representation (all 1-bits have been seen on systems without an MMU, where actually writing to address 0 could break the OS :-). In any case, both 0 and nullptr will represent the proper value, whatever it is. Bo Persson |
| "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Nov 19 09:43PM +0100 On 19.11.2019 20:49, Soviet_Mario wrote: > Is it a bigger than bigger ram address value ? > I'm confused about the pointer "nullity" management. > Long ago casting a 0 had been enough :\ It's just the IDE bullying you. `nullptr` is more safe than `0`, because the latter can be interpreted as integer zero. However, `0` can be more readable. It's not a choice that the IDE can reasonably make, so check if you can configure it away? The `nullptr` notation originated with Scott Meyers, who defined a nullptr_t class in the C++03 days. And so, following that design, `nullptr` in itself designates a value, of type `nullptr_t`, that is /convertible/ to any T* nullpointer. One nice feature of that scheme is that one can use `nullptr_t` as a function parameter type. A nullpointer of a given type T* is a nullpointer regardless of notation, and it's not guaranteed to be the bitpattern all zeroes even when it's designated by `0`. - Alf |
| Paavo Helde <myfirstname@osa.pri.ee>: Nov 20 12:06AM +0200 On 19.11.2019 21:49, Soviet_Mario wrote: > I still sometimes write C-like casts like > if (MyPointer == (classPincoPallo *)(0)) {} This should read: if (!MyPointer) { /*...*/ } or if you insist: if (MyPointer == nullptr) { /*...*/ } There is no point in adding extra noise to your code. |
| "Öö Tiib" <ootiib@hot.ee>: Nov 19 02:25PM -0800 On Tuesday, 19 November 2019 21:49:57 UTC+2, Soviet_Mario wrote: > if (MyPointer == static_cast <classPincoPallo *> (0)) {} > and it again complaints until i correct further to > if (MyPointer == static_cast <classPincoPallo *> (nullptr)) {} You clearly over-engineered there. Installed also qt-creator to see what Clang-Tidy and Clazy in it say by default and how to change it. By default it seems that: if (MyPointer == 0) // gives warning: zero as null pointer constant if (!MyPointer) // no warnings if (MyPointer == nullptr) // no warnings I actually like last two better so I would not touch it but lets see if it is possible to change so all 3 to give no warnings. Seems that disabling the warning .pro file like ... QMAKE_CXXFLAGS += "-Wno-zero-as-null-pointer-constant" ... removes it also in editor. |
| Melzzzzz <Melzzzzz@zzzzz.com>: Nov 19 03:53AM > auto is_in( const initializer_list<Value>& list, const Value v ) > -> bool > { return false; } why not just auto? What's the point of both auto and return type? -- press any key to continue or any other to quit... U ničemu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec Svi smo svedoci - oko 3 godine intenzivne propagande je dovoljno da jedan narod poludi -- Zli Zec Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi bili naoruzani. -- Mladen Gogala |
| "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Nov 19 12:48PM +0100 On 19.11.2019 04:53, Melzzzzz wrote: >> -> bool >> { return false; } > why not just auto? What's the point of both auto and return type? It may be that you're asking about the syntax. Well, `auto f() -> T` for /trailing return type/ was introduced in C++11. Now that you have a name you can look it up. `auto` for /deduced return type/, like `auto f() { return 3; }` was introduced in C++14, almost like sabotage of the C++11 syntax. Apparently support for `auto auto`, writing `auto f() -> auto { return 3; }` in order to specify deduced return type explicitly, was introduced in C++17. But of this I'm less sure. Even though compilers I've tried accept the syntax I don't even know, 100%, that it's valid C++. --- It may alternatively be that you're asking why most C++ programmers still generally specify return types instead of using deduced return type. A deduced return type can be very convenient for e.g. a `begin()` member function that just defers the work to some member container's `begin()`. But a deduced return type can in the worst case mean that you have to delve to the bottom of an arbitrary long call chain in order to find out what the return type, that the compiler knows, is. On the way you may have to do overload resolution and template instantiation just like the compiler, to figure out where these calls go. You may have to use a debugger. That's just a waste of time for the programmer. And so it's strongly counter-productive to use this feature in general. --- If you meant the second interpretation, then I think a better question is whether there are programmers who regularly use deduced return type, and if so, what on Earth makes them do that counter-productive thing? In my opinion, if they exist, then they're likely a collection of total incompetents, the genuinely insane and maybe herd followers, just as with any group that does irrational things: some are insane, some don't understand any of it, and some (in religion that's most) follow the herd in order to derive social advantages, or avoid social disadvantage. But I would guess that any group of C++ programmers using deduced return type is not yet large enough that there would be any herd followers. - Alf |
| Melzzzzz <Melzzzzz@zzzzz.com>: Nov 19 07:48PM > in order to derive social advantages, or avoid social disadvantage. > But I would guess that any group of C++ programmers using deduced return > type is not yet large enough that there would be any herd followers. Just one question. What's the point of auto then? -- press any key to continue or any other to quit... U ničemu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec Svi smo svedoci - oko 3 godine intenzivne propagande je dovoljno da jedan narod poludi -- Zli Zec Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi bili naoruzani. -- Mladen Gogala |
| "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Nov 19 09:31PM +0100 On 19.11.2019 20:48, Melzzzzz wrote: > Just one question. What's the point of auto then? It's still unclear what you're asking about. You quoted everything to be sure not to give any indication. I snipped all that. If you're asking about the syntax, then in C++11 the point was that `auto` was an available keyword to use in the new syntax. The original meaning in C, of automatic storage, was covered by that being the default. For the new syntax, trailing return type, it was not mnemonic, but it was deemed better than the other available keyword, `register`. register foo() -> int Nah. But the committee could have chosen to use operator notation, like the lambda notation: [] foo() -> int Then they'd have had a nice notation where the difference between a named function and a basic unnamed one (lambda), would simply be that no name was provided for the unnamed one. One conceptual problem with this scheme is that the named functions would be declarations while the unnamed ones would be expressions. I don't offhand see that the possibility of `[]` occurring in a possible-declaration context would be problematic for a compiler, e.g. leading to parse ambiguities, but maybe it would -- the committee includes folks from compiler vendors, folks who know a lot about the inner workings. There is however a problem of similar notation implying similar functionality. And it doesn't make much sense to specify captures for a named function declaration. Alternatively the committee could have chosen to open up for new kinds of identifiers, such as `#foo` and `$foo`, to use as new keywords (the problems with these is that they can introduce conflicts with existing preprocessing, in particular #foo with the *nix convention for shell scripts). Or they could have chosen to introduce contextual keywords, keywords that are only keywords in certain contexts, which would reduce or eliminate breakage of existing code. Or they could have chosen to simply add new keywords as they've now done in C++20 (there's a host of them). Or they could go for ugliness, like `__foo`, which is safe and readable but just ugly. They chose neither of these approaches. I.e. they were still very very conservative for C++11, going for technical safety instead of readability where readability mattered, and now in C++20 for more esoteric little used features they feel more free. :( - Alf |
| Melzzzzz <Melzzzzz@zzzzz.com>: Nov 19 09:20PM > default. For the new syntax, trailing return type, it was not mnemonic, > but it was deemed better than the other available keyword, `register`. > register foo() -> int I think that all that matter is exercize in futility. We already have function syntax, this one has sence only on unspecified return type, for what auto keyword is handy. I will never use it in my code as it can serve just to bring confusion... -- press any key to continue or any other to quit... U ničemu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec Svi smo svedoci - oko 3 godine intenzivne propagande je dovoljno da jedan narod poludi -- Zli Zec Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi bili naoruzani. -- Mladen Gogala |
| "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Nov 19 10:51PM +0100 On 19.11.2019 22:20, Melzzzzz wrote: > function syntax, this one has sence only on unspecified return type, > for what auto keyword is handy. I will never use it in my code as it can > serve just to bring confusion... Whether that is likely true or not, you are now feeling competent to evaluate something that you have just shown you didn't understand moments ago. It's unlikely that you have gained a full understanding in so short a time, and committing to an evaluation this early makes the climb towards learning more, more difficult. If instead you keep an open mind, defer the rash impulse to evaluate, you may learn new things faster. - Alf |
| Melzzzzz <Melzzzzz@zzzzz.com>: Nov 19 09:58PM > Whether that is likely true or not, you are now feeling competent to > evaluate something that you have just shown you didn't understand > moments ago. I undertstood it perfectly since auto keyword brought me for purpose auto return type. I understand that you like new syntax for functions more, but I don't call it C++... > It's unlikely that you have gained a full understanding in so short a > time, and committing to an evaluation this early makes the climb towards > learning more, more difficult. What short time? C++14 was released years ago... > If instead you keep an open mind, defer the rash impulse to evaluate, > you may learn new things faster. This is not matter of open mind rather C++. That syntax is not C++ rather SomeOtherLanguage... -- press any key to continue or any other to quit... U ničemu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec Svi smo svedoci - oko 3 godine intenzivne propagande je dovoljno da jedan narod poludi -- Zli Zec Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi bili naoruzani. -- Mladen Gogala |
| David Brown <david.brown@hesbynett.no>: Nov 19 08:26AM +0100 On 19/11/2019 00:21, Sam wrote: > But I will not refrain from enjoying a cost-free source of cheap > entertainment just because someone else gets upset. It just makes no > logical sense for me to do so. I appreciate your right to post the way you want here, and I fully appreciate your motive of cheap entertainment. But there comes a point in which such threads become more akin to Calvin and Hobbes "You're a potty mouth! No, /you're/ a potty mouth!". Surely that can no longer be entertaining? Bonita does not seem to be going anywhere - you'll get plenty of new chances in the future, and perhaps an opportunity for new and more varied insults. |
| Sam <sam@email-scan.com>: Nov 19 06:38AM -0500 David Brown writes: > Bonita does not seem to be going anywhere - you'll get plenty of new chances > in the future, and perhaps an opportunity for new and more varied insults. Sounds like a plan, to me. |
| Keith Thompson <kst-u@mib.org>: Nov 19 10:29AM -0800 Sam <sam@email-scan.com> writes: [..] > a result, this is unfortunate; but they are free to make their > own decisions (and also threaten to ban me from offending their > delicate eyeballs, as well, if it makes them feel better). The purpose of this newsgroup is to discuss C++. I don't recall seeing you do so here. If your personal entertainment is more important than sticking to the topic of the newsgroup, I can get along without seeing any of your contributions, so I'll add you to my killfile as well. I find it rude that you impose on the other readers of this newsgroup the burden of either adjusting their filters or reading your off-topic and frankly boring "entertainment". I encourage you to stop, but it will no longer matter to me personally. Bye. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst> Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */ |
| "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Nov 18 06:24PM -0800 On 11/18/2019 5:25 AM, James Kuyper wrote: >> My point is that hammering a single mutex should not crash the system. > But, Scott already said that a crashing was not expected, so why the "me > too" post? Habit? Sorry. |
| You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment